/*
 * Copyright (c) 2012, Marcin Czekaj
 * All rights reserved.
 *
 * This software is open-source under the BSD license; see LICENSE.TXT for a description.
 */
package pl.edu.uj.fais.graph.elements;

public class Node {
    
    private static int COUNTER = 1;
    
    private final int id = COUNTER++;
    private String label;
    private double x;
    private double y;
    
    public static void resetCounter() {
        COUNTER = 1;
    }
    
    public int getId() {
        return id;
    }
    
    public void setLabel(String label) {
        this.label = label;
    }
    
    public String getLabel() {
        return label;
    }
    
    public void setPosition(double x, double y) {
        this.x = x;
        this.y = y;
    }
    
    public double getX() {
        return x;
    }
    
    public double getY() {
        return y;
    }
    
    @Override
    public String toString() {
        return (label != null) ? label : "Node " + id;
    }
    
    public boolean isProxyNode() {
        return false;
    }
}
